import { Injectable } from '@nestjs/common';
const ChatBot = require('dingtalk-robot-sender');

@Injectable()
export class AppService {
  robot;
  constructor() {
    this.robot = new ChatBot({
      webhook: 'https://oapi.dingtalk.com/robot/send?access_token=964f7ac235887bf571f63afde6b29a001f57f1955879f04dd7621458255d6f2b',
    });
  }
  getHello(): string {
    return 'Hello World!';
  }
  sendMsg(req): string {
    console.log(req);
    // const textContent = {
    //   msgtype: "markdown",
    //   markdown: {
    //     text: "【安心筑】这是一条测试消息",
    //     title: '机器人',
    //   },
    //   at: {
    //     atMobiles: ['18782961711'],
    //   },
    //   isAtAll: false,
    // };
    // this.robot.send(textContent).then(res => {
    //   console.log(res);
    // });
    return 'sendMsg';
  }
}
